Attribute VB_Name = "ModEncrypt"
Public Function encrypt(ByVal pass As String) As String
  If Trim(pass) = "" Then Exit Function
  
  ReDim chars(Len(pass) - 1)
  'Dim arrSalt() As Integer
  Dim val As Integer: val = 84
  Dim arrIndex As Integer
  arrIndex = 0
  
  arrSalt = Array(38, 68, 29, 68, 26, 32)
  
  For i = 0 To Len(pass) - 1
    getChar = Mid(pass, i + 1, 1)
    If Asc(getChar) <> 0 Then
      If i Mod 2 = 0 Then
        For ii = 0 To arrSalt(arrIndex)
          getChar = Chr(Asc(getChar) + 1)
          If Asc(getChar) = 255 Then getChar = Chr(32)
        Next
      Else
        For ii = 0 To arrSalt(arrIndex)
          getChar = Chr(Asc(getChar) - 1)
          If Asc(getChar) = 32 Then getChar = Chr(255)
        Next
      End If
    
      chars(i) = getChar
      arrIndex = arrIndex + 1
      If arrIndex > UBound(arrSalt) Then arrIndex = 0
    End If
  Next
  
  encrypt = Join(chars, "")
End Function
